#ifndef PROJECTILEMANAGER_H
#define PROJECTILEMANAGER_H

#include "EntityProjectile.h"
#include "IProjectileManager.h"
#include <vector>
using std::vector;

//!Class to handle projectile. It creates  template of projectile and allocate projectile.
class CProjectileManager : public IProjectileManager
{
private:

	//!Store references of projectiles stored in the World Model.
	vector<CEntityProjectile*> m_vectorProjectile;

	//!Store references of projectiles template.
	vector<CEntityProjectile*> m_vectorOfProjectileType;


public:
	//!Constructor
	CProjectileManager(void);

	//!Destructor
	~CProjectileManager(void);

	//!Initialise the projectile manager
	void init(void);

	//!Create a projectile template.
	/*!
	\param type type of the projectile template.
	\param indexTextureProjectile index of the texture of the projectile.
	\param indexSpriteProjectile sprite index in the texture.
	\param speed Speed of the projectile.
	\param healthPoint health point of the projectile.
	\param damagePoint damage that a collision with the projectile does.
	*/
	void createProjectileType(eProjectileType type, int indexTextureProjectile, int indexSpriteProjectile, 
		int speed, int healthPoint, int damagePoint);

	//!Create blank projectiles on the world model.
	/*!
	\param numberOfEntities The number of projectiles to create.
	\return True if all the projectile have been initialised. False if it failed.
	*/
	bool createProjectiles(int numberOfEntities);

	//!Activate a blank projectile.
	/*!
	\param projectileType The type of projectile to activate.
	\param position The position of the projectile.
	\param toTheRight The direction of the projectile. True if it goes to the right, false if it goes to the left.
	\param side The side of the projectile.
	*/
	bool activeProjectile(eProjectileType projectileType, const CVector2i& position, bool toTheRight, eSide side);
};

#endif
